<template>
	<view class="bg-widths">
		<view v-for="(item,index) in list" :key="index">
			<view @click="itemClick(item)" class="item ">
				<view class="flex-row-space-between">
					<view @click.stop="itemClick1(item)" class="flex-row-flex-start">
						<image class="headImage" :src="item.user_avatar" mode="aspectFill"></image>
						<view class="name">
							{{item.user_nickname}}
						</view>
					</view>
					<view class="state">

						<text v-if="item.status==1">报名</text>
						<text v-if="item.status==2">进行中</text>
						<text v-if="item.status==3">已结束</text>
					</view>
				</view>
				<view class="flex-row-flex-start" style="margin-top: 20rpx;">
					<image class="image1" :src="item.image" mode="aspectFill"></image>
					<view class="flex1">
						<view class="title">
							{{item.title}}
						</view>
						<view class="titleView flex-row-flex-start">
							<image class="time" src="/static/home/time.png" mode=""></image>
							<view class="title1">
								{{item.start_time}}
							</view>
						</view>
						<view class="titleView flex-row-flex-start">

							<image class="time" src="/static/home/address.png" mode=""></image>
							<view class="title1 flex1">
								{{item.city}}-{{item.address}}
							</view>
						</view>
						<view class="titleView flex-row-flex-start">
							<image class="time" src="/static/home/money.png" mode=""></image>
							<view class="title1">

								活动费用: <text v-if="item.fee_type==1">我方承担</text>
								<text v-if="item.fee_type==2">全部AA</text>
								<text v-if="item.fee_type==3">对方承担</text>
								<text style="margin-left: 10rpx;"> <text v-if="item.status==1"> 报名:({{item.user_list.length}}/{{item.max}})</text>
									<text v-if="item.status==2">参与:({{item.pitch_on_list.length}}/{{item.max}})</text>
									<text v-if="item.status==3">参与:({{item.pitch_on_list.length}}/{{item.max}})</text>
									
									
								</text>

							</view>
						</view>

						<view v-if="item.status==1" class="flex-row-flex-start flex-wrap" style="margin-left: 20rpx;margin-top: 20rpx;">
							<view v-for="(item1,index1) in item.user_list" :key="index1">
								<view @click.stop="headImage1View(item1)" class="headImage1View">
									<image :src="item1.avatar" mode="aspectFill"></image>
								</view>

							</view>
						</view>
						<view v-else class="flex-row-flex-start flex-wrap" style="margin-left: 20rpx;margin-top: 20rpx;">
							<view v-for="(item1,index1) in item.pitch_on_list" :key="index1">
								<view @click.stop="headImage1View(item1)" class="headImage1View">
									<image :src="item1.avatar" mode="aspectFill"></image>
								</view>
						
							</view>
						</view>

					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		name: "intelligent",
		data() {
			return {

			};
		},
		props: {
			list: {
				default: []
			},

		},
		created() {

		},
		methods: {
			itemClick(item) {
				console.log(item)
				if (!uni.getStorageSync('token')) {
					return uni.navigateTo({
						url: '/bundle/pages/login/login'
					})
				}
				uni.navigateTo({
					url: '/bundle/pages/my/intelligentDetail?id=' + item.id
				})

			},
			headImage1View(item){
				if (!uni.getStorageSync('token')) {
					return uni.navigateTo({
						url: '/bundle/pages/login/login'
					})
				}
				uni.navigateTo({
					url: '/bundle/pages/my/intelligentDetail1?id=' + item.id
				})
			}	,
			itemClick1(item) {
				console.log(item)
				if (!uni.getStorageSync('token')) {
					return uni.navigateTo({
						url: '/bundle/pages/login/login'
					})
				}
				uni.navigateTo({
					url: '/bundle/pages/my/intelligentDetail1?id=' + item.user_id
				})

			},
			imagesClick1(item, index) {
				uni.previewImage({
					urls: item,
					current: index
				})
			},
			imagesClick(item, index) {
				uni.previewImage({
					urls: [item.avatar],
					current: 0
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg-widths {
		// width: 690upx;
		margin: 0 auto;
	}

	.item {
		padding: 20rpx;
		margin: 10rpx;
	}

	.headImage {
		width: 52rpx;
		height: 52rpx;
		border-radius: 50%;
	}

	.name {
		margin-left: 10rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 550;
		font-size: 34rpx;
		color: #333333;
	}

	.state {
		font-family: PingFang SC, PingFang SC;
		font-weight: 550;
		font-size: 30rpx;
		color: #2CD6C5;
	}

	.image1 {
		width: 290rpx;
		height: 290rpx;
		margin-right: 20rpx;
	}

	.title {
		font-family: PingFang SC, PingFang SC;
		font-weight: 550;
		font-size: 34rpx;
		color: #333333;
	}

	.titleView {
		margin-top: 16rpx;
	}

	.title1 {
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #797979;
	}

	.headImage1View {
		margin-left: -20rpx;
		width: 60rpx;
		height: 60rpx;
		background: #f7f7f7;
		border-radius: 50%;
		image {
			width: 100%;
			height: 100%;
			border: 2rpx solid #FFFFFF;
			border-radius: 50%;
		}
	}

	.time {
		margin-right: 10rpx;
		width: 28rpx;
		height: 28rpx;
	}
</style>